package com.stars.home.vmodel

import android.app.Application
import android.text.TextUtils
import androidx.lifecycle.MutableLiveData
import com.stars.home.fragment.AccountBillFragment
import com.stars.home.model.AmountCount
import com.stars.home.model.User
import com.stars.home.utils.net.NetEngine
import com.trailer.base.base.BRRepository
import com.trailer.base.base.BRViewModel
import com.trailer.base.net.IResp

/**
 *
 *on 2020/9/18
 */
class IncomeListVModel(application: Application) : BRViewModel<BRRepository>(application) {

    var type:String?="1"
    var status:String?="0"

    val user: MutableLiveData<User?> = MutableLiveData(User.get())
    var info: MutableLiveData<AmountCount> = MutableLiveData<AmountCount>()

    var fragment: AccountBillFragment? = null
   // var status = "0"


    fun setChoseType(type:String?):String{
        if(!TextUtils.isEmpty(type)&&type.equals("1")){
            return "平台"

        }else{
            return "轿车"
        }
    }


    override fun apiFunc(): suspend () -> IResp<*> {

        if(type.equals("1")){//平台订单


        }else{//轿车订单

        }

        return {
            NetEngine.service.QueryList(type, status,"10", repository().page)
        }
    }
}
